﻿window.version = "v1";

//window.server = "http://192.168.0.239:8089/";
//window.server = "http://localhost:8089/";

window.api = {
    login: server + "login",//post {username,password}
    logout: server + "loginOut",//POST 
    userInfo: server + "user/userInfo",
    modifyPassword: server + "app/manager/editPassword", //POST:originalPassword,newPassword

    jwtTest: server + "jwtTest",
    navigate: server + "navigate",

    //系统参数配置
    sysDictGetType: server + "sysDict/getType",//获取编码类型
    sysDictGetTypeChildren: server + "sysDict/getTypeChildren",//系统参数分页查询
    sysDictSelectView: server + "sysDict/selectView",//获取记录详情
    sysDictUpdateView: server + "sysDict/updateView",//修改系统参数
    sysDictDeleteView: server + "sysDict/deleteView",//删除系统参数

    applicationsInsert: server + "applications/insert",
    applicationsUpdate: server + "applications/update",
    applicationsDelete: server + "applications/delete",
    applicationsSelectOne: server + "applications/selectOne",
    applicationsSelectAll: server + "applications/selectAll",
    applicationsSelectPageList: server + "applications/selectPageList",//分页
    applicationsGetKeyValue: server + "applications/getKeyValue",//得到下拉框列表
    applicationsReSort: server + "applications/reSort",//重新整理

    //部门
    thSysDeptGetDeptTree: server + "thSysDept/getDeptTree",//得到部门的树形结构
    //用户管理
    userGetPageView: server + "user/getPageView",//得到用户的分页grid
    userSelectView: server + "user/selectView",//得到用户详情
    userUpdateView: server + "user/updateView",//新增修改用户
    userDeleteView: server + "user/deleteView",//删除用户
    userResetPassword: server + "user/resetPassword",//重置用户密码
    //菜单
    getMenuTree: server + "thSysNavigation/getMenuTree",
    thSysNavigationUpdateView: server + "thSysNavigation/updateView",
    thSysNavigationSelectView: server + "thSysNavigation/selectView",
    thSysNavigationDeleteView: server + "thSysNavigation/deleteView",
    //菜单按钮
    navEventGetPageViewByNavId: server + "thSysNavigationEvent/getPageViewByKey",
    navEventSelectView: server + "thSysNavigationEvent/selectView",
    navEventDeleteView: server + "thSysNavigationEvent/deleteView",
    navEventUpdateView: server + "thSysNavigationEvent/updateView",

    //角色管理
    thSysRoleUpdateView: server + "thSysRole/updateView",
    thSysRoleSelectView: server + "thSysRole/selectView",
    navRoleInfoGetPageViewByKey: server + "thSysNavigationRoleInfo/getPageViewByKey",
    navRoleInfoDeleteView: server + "thSysNavigationRoleInfo/deleteView"

};

//window.routerServer = "http://192.168.0.239/";
//window.routerServer = "http://localhost:50622/";

window.router = {
    login: routerServer + "login.html",
    logout: routerServer + "logout.html",
    index: routerServer + "index.html",

    groupForm: routerServer + "pages/group/form.html",
    applicationsForm: routerServer + "pages/applications/form.html",
    moduleForm: routerServer + "pages/module/form.html",
    rolesForm: routerServer + "pages/roles/form.html",
    rolesTreeform: routerServer + "pages/roles/treeform.html",

    //菜单
    menuForm: routerServer + "form.html",
    //菜单按钮
    btnForm: routerServer + "btnForm.html",
    //角色
    roleForm: routerServer + "form.html",
    roleUserForm: routerServer + "userForm.html",

    userForm: routerServer + "pages/user/form.html",
    passwordForm: routerServer + "pages/user/passwordForm.html",
    baseParamForm: routerServer + "pages/baseParam/form.html",
    materialDicForm: routerServer + "pages/materialDic/form.html",

};

var globalAjax = {
    sysAreaItems: function (methods) {
        Network.connect(window.api.sysAreaItems, 'POST', {}, methods);
    },
    logout: function () {
        Network.connect(window.api.logout, 'POST', {});
    },
    applicationsGetKeyValue: function (methods) {
        Network.connect(window.api.applicationsGetKeyValue, 'POST', {}, methods);
    },
    moduleGetTopModule: function (methods) {
        Network.connect(window.api.moduleGetTopModule, 'POST', {}, methods);
    },
    thSysDeptGetDeptTree: function (methods) {
        Network.connect(window.api.thSysDeptGetDeptTree, 'POST', {}, methods);
    },
    rolesGetKeyValue: function (methods) {
        Network.connect(window.api.rolesGetKeyValue, 'POST', {}, methods);
    },
    paramGetType: function (methods) {
        Network.connect(window.api.paramGetType, 'POST', {}, methods);
    },
    baseParamGetZC: function (methods) {
        Network.connect(window.api.baseParamGetZC, 'POST', {}, methods);
    },
    userLoginIdIsExist: function (data, methods, async) {
        Network.connect(window.api.userLoginIdIsExist, 'POST', data, methods, async);
    }
}